﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace ModelLayer
{
    [DataContract]
    public class Employee : Person
    {
        [DataMember]
        public double Salary { get; set; }
        [DataMember]
        public string Account { get; set; }
        [DataMember]
        public string Position { get; set; }


        public Employee()
        {
            
        }
        //Overrides equals to compare persons objects by their phone number
        public override bool Equals(object _obj)
        {
            bool equal = false;
            Employee objEmployee = (Employee)_obj;

            if (PhoneNo.Equals(objEmployee.PhoneNo))
            {
                equal = true;
            }
            return equal;
        }
        //To represent the object in a string
        public override string ToString()
        {
            return string.Format("Position: {0} \n Salary: {1} \n Account: {2}", Position, Salary, Account);
        }
    }
}
